Hide minor edits - Show changes to markup
This tut ought to teach you how to add fully-functional medics in your game. They folow the player around and heal him at certain points. They're all predefined in friendly.scr so we don't mess with them here.
First off, make a room. I made mine 1 shaped, so that the player begins at the top left (the ` part) and works his way down to the bottom (the _ part, going through the | bit).
Add an info->player->start and a medic model, use 1st-ranger_medic.tik. i belive 2nd-ranger has a medic as well but i commonly use 1st. they have backpacks. They look kewl. :)
Herm.. in any case, add your medic, and give him the folowing properties:
| Key | Value |
|---|---|
| targetname | friendly1 |
| #fnum | 1 |
| distance | 100 |
| friendtype | 5 |
Bring up the AI properties window (it's easier this way) and configure his health to about 300 (good for a medic) and give him a colt 45. Keep his accuracy low, he is a medic after all.
Okay, add some regular enemies or spawn them as you wish, it won't matter how many or anything, just enough to hurt you to about 15 health. Besides, what's the fun of a map without some challenge?
Unless there's anything else you wish to add, let's continue to scripting!
The script is easy to follow.... and so is the player...
main: exec global/ai.scr exec global/friendly.scr level waittil prespawn level waittil spawn thread guns thread squad end guns: $player item weapons/colt45.tik $player item weapons/shotgun.tik $player ammo pistol 200 $player ammo shotgun 10 // weeeeee, we all like shotguns right? end squad: $friendly1.targetname = medic // we always relate to a guy beter when he isn't a number right? $medic.destination = $player $medic thread global/friendly.scr::friendlythink $medic.maxhealth = 300 $medic reload //cinematic only.... just for effect. end
Okay, that's it. Add some ambientlight, compile, and play!!
What'll happen? Your medic will follow you around and keep his nose pretty much clean. If forced he will fire but mostly is docile. When you're health is depleted a certain amount, he will hand you health. As far as i know, it's random between a canteen and 50 health pack.
Well i think medics work best in squads, so in a follow-up map i made a small squad, the default for me of that is:
2 privates 1 medic with a colt 1 engineer with either a shotgun or bazooka 1 sergeant with a browning 1 captain
And recompiled with more enemies. It made much more fun, especially when i added an infinite while loop to spawn a new wave of enemies every 5 seconds.(:twisted:)
If you enjoy mindless fighting on the front lines, that's the map for you.
Cheers all, hope this helps!
- reptilian_mapper B-)